nums = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]


def quick_sort(nums):
    if len(nums) <= 1:
        return nums
    pivot = nums[0]
    left = [x for x in nums[1:] if x <= pivot]
    right = [x for x in nums[1:] if x > pivot]
    return quick_sort(left) + [pivot] + quick_sort(right)


print(quick_sort(nums))
